<include file="Public:header" />
<style>
td span { display:block; color:#777; }
</style>
<div id="zoneHeader">
    <h2>计划报表</h2>
</div><!--/#zoneHeader-->
<div id="zoneBody">
    <div id="zoneBodySearch">
        <form id="formSearch" action="?c={$Think.const.CONTROLLER_NAME}">
            <input type="hidden" name="sort" />
            <input type="hidden" name="sortdir" />

            <ul>
                <li><b>日期：</b><input type="text" name="day" class="fW100p" t="datebox"></li>
                <li><b>计划编号：</b><input type="text" name="plan_id" class="fW100p" /></li>
                <li><b>计划名称：</b><input type="text" name="plan_name" class="fW150p" /></li>
                <li>
                    <select name="plan_type">
                        <option value="">所有类型计划</option>
                        <option value="cpc">CPC</option>
                        <option value="cpm">CPM</option>
                        <option value="cpv">CPV</option>
                    </select>
                </li>
                <li>
                    <select name="plan_status">
                        <option value="">计划状态</option>
                        <volist name=":C('PLAN_STATUS')" id="vo">
                        <option value="{$key}">{$vo}</option>
                        </volist>
                    </select>
                </li>
                <li rel="searchMoreItem">广告主编号：<input type="text" name="uid" style="width:100px" /></li>
                <li rel="searchMoreItem">标签：
                    <volist name=":C('PLAN_TAG')" id="vo">
                    <label><input type="checkbox" name="tag[]" value="{$key}"><span>{$vo}</span></label>
                    </volist>
                </li>
                <li><button type="button" id="as" class="btnSearch">查询</button></li>
                <li><button type="button" class="btnResetForm">清空表单</button></li>
                <li><label><input type="checkbox" class="btnSearchMore" /><span>高级查询</span></label></li>
            </ul>
        </form>
    </div><!--/#zoneBodySearch-->
    <div id="zoneBodyContent">
        <table class="table2">
            <thead>
                <tr>
                    <th class="tAr" title="计划编号">编号</th>
                    <th>计划名称</th>
                    <th><a href="javascript:;" sort="plan_status">状态</a></th>
                    <th>类型</th>
                    <th class="tAr"><a href="javascript:;" sort="num">结算量</a></th>
                    <th class="tAr" hide="4"><a href="javascript:;" sort="deduction">扣点</a></th>
                    <th class="tAr" hide="4"><a href="javascript:;" sort="click">点/弹次数</a></th>
                    <th class="tAr"><a href="javascript:;" sort="reach">到</a></th>
                    <th class="tAr"><a href="javascript:;" sort="do2_any_click" title="在广告主网站任意位置点击">二次点击</a></th>
                    <th class="tAr" hide="4"><a href="javascript:;" sort="new_user">新流量</a></th>
                    <th class="tAr">电信</th>
                    <th class="tAr">移动</th>
                    <th class="tAr">联通</th>
                    <th class="tAr">WIFI</th>
                    <th class="tAr">4G</th>
                    <th class="tAr">3G</th>
                    <th class="tAr">ios</th>
                    <th class="tAr">Android</th>
                    <th class="tAr" hide="4"><a href="javascript:;" sort="ader_pay">应收金额</a></th>
                    <th class="tAr" hide="4"><a href="javascript:;" sort="siter_income">应付金额</a></th>
                    <th class="tAr" hide="4">盈利</th>
                    <th hide="4">操作</th>
                </tr>
            </thead>
            <tbody>
                <!--<tr class="tAr">-->
                    <!--<td colspan="4">所有页总计</td>-->
                    <!--<td>{$allPageTotal.num}</td>-->
                    <!--<td hide="4">{$allPageTotal.deduction}</td>-->
                    <!--<td hide="4">{$allPageTotal.click}</td>-->
                    <!--<td>{$allPageTotal.reach}<span title="到达率">{:getCtr($allPageTotal['num'] + $allPageTotal['deduction'], $allPageTotal['reach'])}%</span></td>-->
                    <!--<td>{$allPageTotal.do2_any_click}<span>{:getCtr($allPageTotal['reach'], $allPageTotal['do2_any_click'])}%</span></td>-->
                    <!--<td hide="4">{$currPageTotal.new_user}<span title="新流量比率">{:getCtr($allPageTotal['num'] + $allPageTotal['deduction'], $allPageTotal['new_user'])}%</span></td>-->
                    <!--<td>{$allPageTotal.device_1}<span title="PC流量比率">{:getCtr($allPageTotal['num'] + $allPageTotal['deduction'], $allPageTotal['device_1'])}%</span></td>-->
                    <!--<td>{$allPageTotal.device_2}<span title="Android流量比率">{:getCtr($allPageTotal['num'] + $allPageTotal['deduction'], $allPageTotal['device_2'])}%</span></td>-->
                    <!--<td hide="4">{$allPageTotal.ader_pay}</td>-->
                    <!--<td hide="4">{$allPageTotal.siter_income}</td>-->
                    <!--<td hide="4">{:getProfit($allPageTotal['ader_pay'], $allPageTotal['siter_income'])}</td>-->
                    <!--<td class="tAl" hide="4"></td>-->
                <!--</tr>-->
                <!--<tr class="tAr">-->
                    <!--<td colspan="4">当页合计</td>-->
                    <!--<td>{$currPageTotal.num}</td>-->
                    <!--<td hide="4">{$currPageTotal.deduction}</td>-->
                    <!--<td hide="4">{$currPageTotal.click}</td>-->
                    <!--<td>{:getCtr($currPageTotal['view'], $currPageTotal['num'])}%</td>-->
                    <!--<td>{$currPageTotal.reach} <span title="到达率">{:getCtr($currPageTotal['num'] + $currPageTotal['deduction'], $currPageTotal['reach'])}%</span></td>-->
                    <!--<td>{$currPageTotal.do2_any_click}<span>{:getCtr($currPageTotal['reach'], $currPageTotal['do2_any_click'])}%</span></td>-->
                    <!--<td hide="4">{$currPageTotal.new_user}<span title="新流量比率">{:getCtr($currPageTotal['num'] + $currPageTotal['deduction'], $currPageTotal['new_user'])}%</span></td>-->
                    <!--<td hide="4">{$currPageTotal.r_searcher}<span title="搜索流量比率">{:getCtr($currPageTotal['num'] + $currPageTotal['deduction'], $currPageTotal['r_searcher'])}%</span></td>-->
                    <!--<td>{$currPageTotal.device_1}<span title="PC流量比率">{:getCtr($currPageTotal['num'] + $currPageTotal['deduction'], $currPageTotal['device_1'])}%</span></td>-->
                    <!--<td>{$currPageTotal.device_2}<span title="Android流量比率">{:getCtr($currPageTotal['num'] + $currPageTotal['deduction'], $currPageTotal['device_2'])}%</span></td>-->
                    <!--<td hide="4">{$currPageTotal.ader_pay}</td>-->
                    <!--<td hide="4">{$currPageTotal.siter_income}</td>-->
                    <!--<td hide="4">{:getProfit($currPageTotal['ader_pay'], $currPageTotal['siter_income'])}</td>-->
                    <!--<td class="tAl" hide="4"></td>-->
                <!--</tr>-->
                <volist name="page.record" id="vo">
                    <php>
                        $ispNum = $vo['opt_1'] + $vo['opt_2'] + $vo['opt_3'] + $vo['opt_4'];
                        $nettypeNum = $vo['opt_5'] + $vo['opt_6'] + $vo['opt_7'] + $vo['opt_8'];
                        $osNum = $vo['opt_9'] + $vo['opt_10'] + $vo['opt_11'];
                    </php>
                <tr class="tAr">
                    <td>{$vo.plan_id}</td>
                    <td class="tAl">
                        <a href="?c=Plan&id={$vo.plan_id}" target="_blank" title="查询计划信息">{$vo.plan_name}</a>
                    </td>
                    <td class="tAl">{$vo.plan_status|getPlanStatusCn}</td>
                    <td class="tAl">{$vo.plan_type|strtoupper}</td>
                    <td>{$vo.num}
                    <if condition="$vo.plan_type EQ cpv">
                    <br />{$vo.click3} / {:getCtr($vo['num'] + $vo['deduction'], $vo['click3'])}%
                    </if>
                    </td>
                    <td hide="4">{$vo.deduction}</td>
                    <td hide="4">{$vo.click}</td>
                    <td>{$vo.reach}<span title="到达率">{:getCtr($vo['num']+$vo['deduction'], $vo['reach'])}%</span></td>
                    <td>{$vo.do2_any_click}<span>{:getCtr($vo['reach'], $vo['do2_any_click'])}%</span></td>
                    <td hide="4">{$vo.new_user}<br /><span title="新流量比率">{:getCtr($vo['num']+$vo['deduction'], $vo['new_user'])}%</span></td>
                    <td>{:getCtr($ispNum, $vo['opt_1'])}%</td>
                    <td>{:getCtr($ispNum, $vo['opt_2'])}%</td>
                    <td>{:getCtr($ispNum, $vo['opt_3'])}%</td>
                    <td>{:getCtr($nettypeNum, $vo['opt_5'])}%</td>
                    <td>{:getCtr($nettypeNum, $vo['opt_6'])}%</td>
                    <td>{:getCtr($nettypeNum, $vo['opt_7'])}%</td>
                    <td>{:getCtr($osNum, $vo['opt_9'])}%</td>
                    <td>{:getCtr($osNum, $vo['opt_10'])}%</td>
                    <td hide="4">{$vo.ader_pay}</td>
                    <td hide="4">{$vo.siter_income}</td>
                    <td hide="4">{:getProfit($vo['ader_pay'], $vo['siter_income'])}</td>
                    <td class="tAl" hide="4"> <a href="?c=SiterStats&a=index2&day={$Think.get.day}&plan_id={$vo.plan_id}">详情</a> </td>
                </tr>
                </volist>
            </tbody>
        </table>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<div id="zoneFooter">{:W('Page/info', [$page])}</div><!--/#zoneFooter-->
<include file="Public:footer" />
